// import com.alibaba.druid.sql.ast.SQLName;
// import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObjectImpl;
// import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;

#include "OracleSelectRestriction.h"
#include "../../../../ast/SQLName.h"
#include "../../visitor/OracleASTVisitor.h"

OracleSelectRestriction_CheckOption::OracleSelectRestriction_CheckOption()
{
}

// @Override
void OracleSelectRestriction_CheckOption::accept0(OracleASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(OracleSelectRestriction_CheckOption)))
  {
    acceptChild(visitor, this->constraint);
  }

  visitor->endVisit(SharedObject(OracleSelectRestriction_CheckOption));
}

// @Override
SQLObject_ptr OracleSelectRestriction_CheckOption::clone()
{
  SQLObject_ptr clone_tmp = std::shared_ptr<OracleSelectRestriction_CheckOption>(new OracleSelectRestriction_CheckOption());
  std::shared_ptr<OracleSelectRestriction_CheckOption> x = std::dynamic_pointer_cast<OracleSelectRestriction_CheckOption>(clone_tmp);
  // CheckOption x = new CheckOption();
  if (constraint != nullptr)
  {
    x->setConstraint(std::dynamic_pointer_cast<SQLName>(constraint->clone()));
  }
  return x;
}

OracleSelectRestriction_ReadOnly::OracleSelectRestriction_ReadOnly()
{
}

// @Override
void OracleSelectRestriction_ReadOnly::accept0(OracleASTVisitor_ptr visitor)
{
  visitor->visit(SharedObject(OracleSelectRestriction_ReadOnly));

  visitor->endVisit(SharedObject(OracleSelectRestriction_ReadOnly));
}

// @Override
SQLObject_ptr OracleSelectRestriction_ReadOnly::clone()
{
  SQLObject_ptr clone_tmp = std::shared_ptr<OracleSelectRestriction_ReadOnly>(new OracleSelectRestriction_ReadOnly());
  std::shared_ptr<OracleSelectRestriction_ReadOnly> x = std::dynamic_pointer_cast<OracleSelectRestriction_ReadOnly>(clone_tmp);
  // ReadOnly x = new ReadOnly();
  return x;
}

OracleSelectRestriction::OracleSelectRestriction()
{
}

SQLName_ptr OracleSelectRestriction::getConstraint()
{
  return constraint;
}

void OracleSelectRestriction::setConstraint(SQLName_ptr constraint)
{
  if (constraint != nullptr)
  {
    constraint->setParent(SharedObject(OracleSelectRestriction));
  }
  this->constraint = constraint;
}
